#ifndef SIMPLEKEYBOARD_H
#define SIMPLEKEYBOARD_H

#include <QWidget>
#include <QPushButton>
#include <QGridLayout>
#include <QVBoxLayout>
#include <QLineEdit>

/**
 * @brief 简单虚拟键盘
 * 
 * 专为触摸屏设计的简化键盘
 * 包含常用字符、数字和十六进制输入
 */
class SimpleKeyboard : public QWidget
{
    Q_OBJECT

public:
    explicit SimpleKeyboard(QWidget *parent = nullptr);
    ~SimpleKeyboard();
    
    void setTargetWidget(QWidget *target);
    QString getText() const;
    void setText(const QString &text);

signals:
    void textChanged(const QString &text);
    void enterPressed();

private slots:
    void onKeyClicked();
    void onBackspace();
    void onClear();
    void onEnter();

private:
    void setupUI();
    void insertText(const QString &text);
    
    QLineEdit *m_inputLine;
    QWidget *m_targetWidget;
    
    // 按键组
    QList<QPushButton*> m_keyButtons;
};

#endif // SIMPLEKEYBOARD_H

